package com.poland.konradg.test;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;

import org.apache.openejb.client.LocalInitialContextFactory;
import org.junit.Before;

public abstract class AbstractTestCase {

	protected InitialContext initialContext;

	@Before
	public void setUp() throws Exception {
		Properties p = new Properties();
	    p.put(Context.INITIAL_CONTEXT_FACTORY,LocalInitialContextFactory.class.getName());
	    
	    p.put("MyJmsResourceAdapter", "new://Resource?type=ActiveMQResourceAdapter");
	    p.put("MyJmsResourceAdapter.ServerUrl", "tcp://localhost:61616");
	    // Do not start the ActiveMQ broker
	    p.put("MyJmsResourceAdapter.BrokerXmlConfig", "");
	    p.put("MyJmsConnectionFactory", "new://Resource?type=javax.jms.ConnectionFactory");
	    p.put("MyJmsConnectionFactory.ResourceAdapter", "MyJmsResourceAdapter");
	    p.put("MyJmsMdbContainer", "new://Container?type=MESSAGE");
	    p.put("MyJmsMdbContainer.ResourceAdapter", "MyJmsResourceAdapter");
	    p.put("TestTopic1", "new://Resource?type=javax.jms.Topic");
	    p.put("Response", "new://Resource?type=javax.jms.Queue");
	    
	    p.put("TitanDB", "new://Resource?type=DataSource");
		p.put("TitanDB.JdbcDriver", "org.apache.derby.jdbc.ClientDriver");
		p.put("TitanDB.JdbcUrl", "jdbc:derby://localhost:1527/testDB;");
		p.put("TitanDB.UserName", "test");
		p.put("TitanDB.Password", "test");
		
		initialContext = new InitialContext(p);
	}
}
